package org.smart4j.chapter.util;

import org.apache.commons.collections4.MapUtils;

import java.util.Collection;
import java.util.Map;

/**
 * Title: CollectionUtil
 * Description: 集合工具类
 *
 * @vsesion <1> 2018-06-24 16:08 ZhangShen Created.
 */
public final class CollectionUtil {

    /**
     * 判断Collection是否为空
     * @param collection
     * @return
     */
    public static boolean isEnpty(Collection<?> collection){
        return CollectionUtil.isEnpty(collection);
    }

    /**
     * 判断Collection是否非空
     * @param collection
     * @return
     */
    public static boolean isNotEnpty(Collection<?> collection){
        return !isEnpty(collection);
    }

    /**
     * 判断Map是否为空
     * @param map
     * @return
     */
    public static boolean isEnpty(Map<?, ?> map){
        return MapUtils.isEmpty(map);
    }

    /**
     * 判断Map是否非空
     * @param map
     * @return
     */
    public static boolean isNotEnpty(Map<?, ?> map){
        return !isEnpty(map);
    }
}
